package name.marz.to.go.ahg.mufgbk;

import java.util.Arrays;

import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.params.CookieSpecPNames;
import org.apache.http.impl.cookie.BestMatchSpec;
import org.apache.http.params.HttpParams;

import name.marz.to.go.ahg.core.AutoGetterHttpClient;

public class MUFGbkClient extends AutoGetterHttpClient {
	public MUFGbkClient() {
		super();
		getParams().setParameter(CookieSpecPNames.DATE_PATTERNS,
		         					Arrays.asList("EEE, dd-MMM-yyyy HH:mm:ss")
		         				);
		
		CookieSpecFactory csf = new CookieSpecFactory() {
			@Override
			public CookieSpec newInstance(HttpParams params) {
				return new BestMatchSpec() {
					@Override
					public void validate(Cookie cookie, CookieOrigin origin) throws MalformedCookieException {
						// DO NOTHING
					}
				};
			}
		};
		getCookieSpecs().register("AcceptAll", csf);
		setCookiePolicy("AcceptAll");
	}

}
